package com.zdp.degisn.strategy_model.factory;

import com.zdp.degisn.strategy_model.entity.File;
import com.zdp.degisn.strategy_model.strategy.convert.CellConvertPdf;
import com.zdp.degisn.strategy_model.strategy.convert.ConvertStrategy;
import com.zdp.degisn.strategy_model.strategy.convert.WordConvertPdf;

/**
 * @author zhengdp
 * @Description
 * @Date 2022/9/14 22:21
 * @Created by zhengdp
 */
public class ConvertFactory {

    private ConvertFactory(){}

    public static ConvertStrategy getConvertStrategy(File file){
        switch (file.getFileType()){
            case "WORD":
                return WordConvertPdf.getInstance();
            case "EXCEL":
                return CellConvertPdf.getInstance();
            default:
                return null;
        }
    }

}
